﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CWB.Web.MVC.BaseController;
using CWB.Common.Logging;
using CWB.Web.Models.Configuration;
using CWB.Common.Constant;
using CWB.Web.MVC.Filters;
using CWB.Web.DB;
using CWB.Common.DTO;
using CWB.Web.Configuration;
using CWB.Common.Utilities;

namespace CWB.WebSite.Controllers
{
    [PermissionFilterAttvibute(loginType = LoginType.Bo)]
    public class BouController : MultiCultureBaseController
    {
        private static readonly ISysLog Log = SysLog.GetLogger(typeof(BouController));

        public BouController(LanguageInfo languageInfo)
            : base(languageInfo)
        {
            ControllerPermision = Permission.Private;
        }

        //
        // GET: /Bou/
        public ActionResult Index()
        {
            return View();
        }

        //
        // GET: /Bou/
        public ActionResult Create()
        {
            return View();
        }

        //
        // GET: /Bou/
        [NoClientCacheFilter]
        public ActionResult Update(int id)
        {
            ViewData["sn"] = id;
            DbTableBbu odb = new DbTableBbu();
            int sn = Convert.ToInt32(id);
            try
            {
                DbModuleBbu bbu = odb.getBbuBySn(sn);
                ViewData["error"] = "";
                ViewData["username"] = bbu.username;
            }
            catch
            {
                ViewData["error"] = Localization.TrandlateMessage(Err.TheBackOfficeUserIsNotExist);
                ViewData["username"] = "";
            }
            return View();
        }
    }
}
